<template>
  <keep-alive :include="cacheViews">
    <router-view v-if="keepAlive"></router-view>
  </keep-alive>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  // NestedRouteCache
  name: 'NestedRouteCache',

  props: {},

  data() {
    return {}
  },

  computed: {
    ...mapGetters(['cacheViews', 'visitiedTags']),

    keepAlive() {
      // const resultTag = this.visitiedTags.filter(tag => tag.name === this.$route.name)
      // return resultTag[0].keepAlive
      return this.cacheViews.includes(this.$route.name)
    }
  },

  watch: {},

  created() {},

  methods: {}
}
</script>

<style></style>
